package com.goodwill.androidtest;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.provider.BaseItemProvider;

import java.util.List;

public class TimerControlerWidgetProvider extends BaseItemProvider<Demo, BaseViewHolder> {
    @Override
    public int viewType() {
        return ModuleItemType.TIME;
    }

    @Override
    public int layout() {
        return R.layout.timer_controler_widget_provider;
    }

    @Override
    public void convert(@NonNull BaseViewHolder helper, Demo data, int position) {
        helper.addOnClickListener(R.id.tv_time_content);
        helper.setText(R.id.tv_title, data.getTitle());
        helper.setText(R.id.tv_time_content, data.getValue());
    }

    @Override
    public void convertPayloads(@NonNull BaseViewHolder helper, Demo data, int position, @NonNull List<Object> payloads) {
        super.convertPayloads(helper, data, position, payloads);
        helper.setText(R.id.tv_title, data.getTitle());
        helper.setText(R.id.tv_time_content, data.getValue());
    }
}
